package com.lxk.service;

import com.lxk.pojo.Seckill;
import com.lxk.vo.PageModel;
import com.lxk.vo.SeckillModel;
import com.lxk.vo.SeckillShowModel;

import java.util.List;

/**
 * @author JohnSoybean
 * @create 2020/4/1 13:33
 * @description
 */
public interface SeckillService {

    /**
     * 设置新一期秒杀
     * @param seckill
     * @return seckillId
     */
    Integer setSeckill(Seckill seckill);

    /**
     * 按goodsId获取秒杀
     * @return
     */
    List<Seckill> getSeckillsByGoodsId(Integer goodsId);

    /**
     * 更新秒杀
     * @param seckill
     */
    void updateSeckill(Seckill seckill);

    /**
     * 获取秒杀总页数
     * @param num
     * @return
     */
    Integer getTotalPages(Integer num);

    /**
     * 获取秒杀记录分页
     * @param pageIndex
     * @param num
     * @param totalPages
     * @return
     */
    PageModel<SeckillModel> selSeckillPage(Integer pageIndex, Integer num, Integer totalPages, Integer sort, Integer order);


    /**
     * 获取最新秒杀信息
     * @return
     */
    SeckillShowModel showSeckillGoodsInfo();

}
